package com.yjhh.chdataservice.util;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by hlantian on 2017/10/9.
 */
@Data
public class DataConsts {

    public static final String UNKNOWN = "_UNKNOWN";

    public static final String PRI_DEPT_LEVEL = "A";   //省级别

    //levels->NAMEcolumnName
    private static Map<Integer, String> deptLevelName = new HashMap<Integer, String>();

    //levels->IDcolumnName
    private static Map<Integer, String> deptLevelID = new HashMap<Integer, String>();

    private static Map<Integer, String> pointDeptLevelName = new HashMap<Integer, String>();

    private static Map<String, String> moveTypeMap = new HashMap<>();

    static {
        deptLevelID.put(1, "provinceid.keyword");
        deptLevelID.put(2, "cityid.keyword");  //objfamilyinf
        deptLevelID.put(3, "countryid.keyword");
        deptLevelID.put(4, "townid.keyword");
        deptLevelID.put(5, "deptid.keyword");

        deptLevelName.put(1, "provincename.keyword");
        deptLevelName.put(2, "cityname.keyword");
        deptLevelName.put(3, "countryname.keyword");
        deptLevelName.put(4, "townname.keyword");
        deptLevelName.put(5, "deptname.keyword");

        pointDeptLevelName.put(1, "provinc.keyword");
        pointDeptLevelName.put(2, "city.keyword");
        pointDeptLevelName.put(3, "country.keyword");
        pointDeptLevelName.put(4, "town.keyword");
        pointDeptLevelName.put(5, "deptname.keyword");


        moveTypeMap.put(RemoveType.ALL, "十三五规划");
        moveTypeMap.put(RemoveType.YDFP, "十三五易地扶贫");
        moveTypeMap.put(RemoveType.BZ, "十三五避灾生态");
    }

    public static String getDeptName(int deptLevel) {
        return deptLevelName.get(deptLevel);
    }

    public static String getPointDeptName(int deptLevel) {
        return pointDeptLevelName.get(deptLevel);
    }

    public static String getDeptID(int deptLevel) {
        return deptLevelID.get(deptLevel);
    }

    public static Map<String, String> getMoveTypeMap() {
        return moveTypeMap;
    }

    public interface RemoveType {
        String ALL = "0";   //易地扶贫
        String YDFP = "1";   //易地扶贫
        String BZ = "2";       //避灾
        String ST = "3";       //生态
    }

    public interface ReportRemoveType {
        String ALL = "1";   //合计
        String YDFP = "2";   //易地扶贫
        String BZ = "3";       //避灾
        String ST = "4";       //生态
        String BZST = "5";       //避灾生态合计
    }

    /**
     * 统计指标类型
     */
    public interface ReportIndexType {
        String START_RATE = "1";   //开工率
        String END_RATE = "2";   //竣工率
        String RZ_RATE = "3";       //入住率
        String JZAZ_RATE = "4";       //集中安置率
    }

    /**
     * 脱贫状态
     */
    public interface ThrowOffPovertyStatus {
        String YES = "是";   //易地扶贫
        String NO = "否";   //易地扶贫
    }

    public interface DataStatus {
        Integer DATA_FLAG_OK = 1;  //1：正常
        Integer DATA_FLAG_INVALID = 0;  //0：状态无效
        Integer DATA_FLAG_DELETED = -1;  //-1：删除
    }

    public interface HDFSFileStatus {
        Integer DATA_FLAG_OK = 1;  //1：正常
        Integer DATA_FLAG_WAITING_UPLOAD = 0;  //0：待上传
        Integer DATA_FLAG_DELETED = -1;  //-1：删除
    }

    /**
     * 统计关键指标类型
     */
    public interface StatisticalType {
        String CITY = "city";     //按地市
        String AREA = "area";     //三大片区
    }

    /**
     * 保存政策信息的结果码
     */
    public interface SavePolicyInfoResultCode {
        int TILTE_IS_REQUIRED = -1;
        int POLICY_TYPE_IS_REQUIRED = -2;
        int CONTENT_IS_REQUIRED = -3;
        int TITLE_EXISTED = -4;
        int CONTENT_TYPE_IS_REQUIRED = -5;
    }

    /**
     * 保存政策信息的结果信息
     */
    public interface SavePolicyInfoResultMsg {
        String TILTE_IS_REQUIRED = "政策标题不能为空！";
        String POLICY_TYPE_IS_REQUIRED = "政策类型不能为空！";
        String CONTENT_IS_REQUIRED = "政策内容不能为空！";
        String TITLE_EXISTED = "政策标题已经存在！";
        String CONTENT_TYPE_IS_REQUIRED = "内容类型不能为空！";
        String SUC = "保存成功！";
    }

    /**
     * 修改政策信息的结果码
     */
    public interface UpdatePolicyInfoResultCode {
        int TILTE_IS_REQUIRED = -1;
        int POLICY_TYPE_IS_REQUIRED = -2;
        int CONTENT_IS_REQUIRED = -3;
        int TITLE_EXISTED = -4;
        int CONTENT_TYPE_IS_REQUIRED = -5;
        int POLICY_ID_IS_REQUIRED = -6;
        int DATA_IS_NOT_EXIST = -7;
    }

    /**
     * 修改政策信息的结果信息
     */
    public interface UpdatePolicyInfoResultMsg {
        String TILTE_IS_REQUIRED = "政策标题不能为空！";
        String POLICY_TYPE_IS_REQUIRED = "政策类型不能为空！";
        String CONTENT_IS_REQUIRED = "政策内容不能为空！";
        String TITLE_EXISTED = "政策标题已经存在！";
        String CONTENT_TYPE_IS_REQUIRED = "内容类型不能为空！";
        String POLICY_ID_IS_REQUIRED = "需要修改的政策ID不能为空！";
        String DATA_IS_NOT_EXIST = "数据不存在！";
        String SUC = "保存成功！";
    }

    public interface ReportMoveType{
        String ALL = "1";       //:合计(按人统计)
        String YD = "2";// 2：易地扶贫(按人统计)
        String BZ = "3";// 3：避灾(按户统计)
        String ST = "4";// 4：生态(按户统计)
        String BZST = "5";// 5:避灾生态合计(按户统计)
    }

}
